﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace thailandProject.Models
{
    public class Test_Task
    {
        public enum TASK_TYPE { PICKUP = 0, DROPOFF = 1, CUSTOM = 2 };
        
        public string TaskName { get; set; }
        public TASK_TYPE Type { get; set; }
        public DateTime TaskEndDate { get; set; }
        public string TaskLocation { get; set; }
        public string ReservationLocation { get; set; }
        public DateTime ReservationStartDate { get; set; }
        public DateTime ReservationEndDate { get; set; }
        public string TaskNotes { get; set; }
        public bool IsDone { get; set; }

        /// <summary>
        /// Returns testing data to the controller. Intended for testing use only
        /// </summary>
        /// <returns>IEnumerable containing test data</returns>
        public static IEnumerable<Test_Task> getTestingData()
        {
            //LinkedList is of type IEnumerable
            LinkedList<Test_Task> rt = new LinkedList<Test_Task>();

            try
            {
                #region Test_Task object 1
                Test_Task test1 = new Test_Task();
                test1.TaskName = "Joanne Jane";
                test1.Type = TASK_TYPE.PICKUP;
                test1.TaskEndDate = DateTime.Now;
                test1.TaskLocation = "Chiang Mai International";
                test1.ReservationLocation = "Apartment 214";
                test1.ReservationStartDate = new DateTime(2013, 4, 5);
                test1.ReservationEndDate = new DateTime(2013, 4, 24);
                test1.TaskNotes = "Loves flowers in her room when she arrives\n\n" +
                    "She is from my home town\n\n" +
                    "She wants to ride an elephant\n\n" +
                    "She registered a year and a half in advance";
                test1.IsDone = true;
                #endregion

                #region Test_Task object 2
                Test_Task test2 = new Test_Task();
                test2.TaskName = "John Smith";
                test2.Type = TASK_TYPE.DROPOFF;
                test2.TaskEndDate = new DateTime(2013, 4, 3, 18, 30, 0); //April 3rd, 2013 6:30 PM
                test2.TaskLocation = "Chiang Mai International";
                test2.ReservationLocation = "Condo 595";
                test2.ReservationStartDate = new DateTime(2013, 3, 1);
                test2.ReservationEndDate = new DateTime(2013, 4, 5);
                test2.TaskNotes = "Love Jack Daniels in his apartment\n\n" +
                    "Girlfriend loves poinsettias\n\n" +
                    "This is his 4th reservation from me";
                test2.IsDone = false;
                #endregion

                #region Test_Task object 3
                Test_Task test3 = new Test_Task();
                test3.TaskName = "Pick up Groceries"; //I'll let the ClientName also double as a custom task title
                test3.Type = TASK_TYPE.CUSTOM;
                test3.TaskEndDate = new DateTime(2013, 4, 4); //April 4th, 2013
                test3.TaskLocation = String.Empty;
                test3.ReservationLocation = "";
                test3.ReservationStartDate = new DateTime(2013, 1, 1);
                test3.ReservationEndDate = new DateTime(2013, 1, 1);
                test3.TaskNotes = "I need some vegetables and soy sauce";
                test3.IsDone = true;
                #endregion

                #region Test_Task object 4
                Test_Task test4 = new Test_Task();
                test4.TaskName = "Kill the Maid"; //I'll let the ClientName also double as a custom task title
                test4.Type = TASK_TYPE.CUSTOM;
                test4.TaskEndDate = new DateTime(2013, 4, 6); //April 6th, 2013
                test4.TaskLocation = String.Empty;
                test4.ReservationLocation = "";
                test4.ReservationStartDate = new DateTime(2013, 1, 1);
                test4.ReservationEndDate = new DateTime(2013, 1, 1);
                test4.TaskNotes = "The garden has gone untended for far too long...";
                test4.IsDone = false;
                #endregion

                rt.AddLast(test1);
                rt.AddLast(test2);
                rt.AddLast(test3);
                rt.AddLast(test4);
            }
            catch (Exception ex)
            {
                ErrorLog.logError(ex);
            }

            return rt;
        }
    }
}